/**
 * 全局文件配置
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

import 'font-awesome/css/font-awesome.min.css'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/style.scss'
import './assets/fonts/fonts.css' // 引入字体文件
import './assets/icon'
import App from './App'
import imageViewer from './assets/imageViewer'
import './utils/BtnPermissions'
import utils from './utils/utils'
import store from './store'
import router from './router'
import prompt from './components/promptMessage.js'
import VideoPlayer from 'vue-video-player'
import './permission' // permission control，单独建立permission文件时，一定要引入
import Meta from 'vue-meta'
import vueEsign from 'vue-esign'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
import io from 'socket.io-client'
import maxnum from "./utils/directives/maxnum"
const socket = io(`${process.env.SOCKET_URL}?code=kics9`+Date.now()*2) //正式线的socket地址

Vue.prototype.socket = socket

// 实现语音播报 ----------------------------------------------------------------------
import * as voicePromptFun from './constants/playAudio'
// 异常语音
Vue.prototype.msgDingdong = voicePromptFun.msgDingdong
Vue.prototype.report = voicePromptFun.report
Vue.prototype.subscribe = voicePromptFun.subscribe
Vue.prototype.register = voicePromptFun.register
Vue.prototype.samplingAsk = voicePromptFun.samplingAsk
Vue.prototype.samplingPayment = voicePromptFun.samplingPayment
Vue.prototype.receive = voicePromptFun.receive
Vue.prototype.overtimeTemperature = voicePromptFun.overtimeTemperature
Vue.prototype.warnTemperature = voicePromptFun.warnTemperature
//------------------------------------------------------------------------------

require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
// require('./mock.js')
// 注册插件
Vue.use(ElementUI)
Vue.use(VueRouter)
Vue.use(utils)

Vue.use(imageViewer)
Vue.use(prompt)
Vue.use(VideoPlayer)
Vue.use(Meta)
Vue.use(vueEsign) // 电子签名
Vue.use(Viewer) // 图片预览
Vue.use(maxnum)
Viewer.setDefaults({
  Options: {
    inline: true,
    button: true,
    navbar: true,
    title: true,
    toolbar: true,
    tooltip: true,
    movable: true,
    zoomable: true,
    rotatable: true,
    scalable: true,
    transition: true,
    fullscreen: true,
    keyboard: true,
    url: 'data-source'
  }
})

//Vue.use(http);
//Vue.use(print);
//Vue.use(Print);
// Vue.use(config);

Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
